﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace StringContainCountServiceSoapApp
{
    public class StringContainCountServiceSoapApp : IStringContainCountServiceSoapApp
    {

        public int GetCount(string smallString, string container)
        {
            int startIndex = 0;
            int counter = 0;
            while (startIndex != -1)
            {
                startIndex = container.IndexOf(smallString, startIndex + 1);
                counter++;
            }
            return counter;
        }
    }
}
